#
# @lc app=leetcode.cn id=94 lang=python3
#
# [94] 二叉树的中序遍历
#

# @lc code=start
# Definition for a binary tree node.
# class TreeNode:
#     def __init__(self, val=0, left=None, right=None):
#         self.val = val
#         self.left = left
#         self.right = right

class Solution:
    def inorderTraversal(self, root: TreeNode) -> List[int]:
        # @lc code=end
        res = []
        if root == None:
            return []

        else:
            l = self.inorderTraversal(root.left)
            res.extend(l)
            res.append(root.val)
            r = self.inorderTraversal(root.right)
            res.extend(r)
            return res